Conversation
|
👋 Hi! I see this is a draft PR. |
| // tracing_subscriber::fmt() | ||
| // // .with_span_list(true) // <--- print parent span chain | ||
| // .with_span_events(FmtSpan::FULL) | ||
| // .init(); |
There was a problem hiding this comment.
Default trace output, useful to see what's all that we have.
lightning/src/ln/payment_tests.rs
Outdated
| } | ||
|
|
||
| fn do_test_keysend_payments(public_node: bool) { | ||
| let layer = TestTracerLayer {}; |
There was a problem hiding this comment.
Configure layer that produces TestLogger like output with a node id.
| } | ||
|
|
||
| /// A tracing `Layer` that forwards tracing events to a given `Logger`. | ||
| pub struct TracingToLogger<L: Deref> |
There was a problem hiding this comment.
Currently unused, but demonstrates how we can stay backwards compatible with a Logger impl.
| macro_rules! log_info { | ||
| ($logger: expr, $($arg:tt)*) => ( | ||
| $crate::log_given_level!($logger, $crate::util::logger::Level::Info, $($arg)*); | ||
| tracing::info!($($arg)*); |
There was a problem hiding this comment.
No logger instance needed....
| tracing::Level::TRACE => "TRACE", | ||
| }; | ||
|
|
||
| let context = format!( |
There was a problem hiding this comment.
TestLogger compatible output.
| let mut current = Some(span); | ||
| while let Some(s) = current { | ||
| let extensions = s.extensions(); | ||
| if let Some(info) = extensions.get::<NodeInfo>() { |
There was a problem hiding this comment.
Don't ask too many questions about how this code is getting the node id.... Testing only...
d7382cf to
e508636
Compare
Not necessarily a blocker, but may be noteworthy that |
|
I've been exploring what spans could do for us if we'd be using |

Try out to see how
tracingcan be used instead of the currentLogger. Advantages:To keep apart test logs in multi-node tests, a proc macro is used to automatically enter a node specific span at the beginning of each public function.
Tracing dependencies:
Logger cleanup preview: main...joostjager:logger-cleanup